<template>
  <!-- 双击行弹窗 -->
  <div>
    <FilterTable
      ref="table"
      columnsRef="waxDealerDoubleFormA"
      :fetchapi="fetchApi"
      :columns="columns"
      :params="fetchParams"
      :datakey="'records'"
      :onColumnsChange="columns => (this.columns = columns)"
      :isSelectColumn="false"
      :isMemoryPagination="true"
    >
    </FilterTable>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button @click="closeDialog">关闭</el-button>
    </div>
  </div>
</template>

<script>
import { getDealerCashList } from '@/api/part/report/dealerRelatedInquiry';
import { dictionary } from '@/utils/dictMixin';
export default {
  name: 'DealerDoubleClick',
  components: {},
  mixins: [dictionary],
  props: ['PERIOD', 'CODE'],
  data() {
    return {
      fetchParams: { xhrAbort: false, ImportParameter: { I_PERIOD2: this.PERIOD, CODE: 'UMNETWR' } },
      fetchApi: getDealerCashList,
      columns: this.createTableColumns()
    };
  },
  methods: {
    closeDialog() {
      this.$emit('close');
    },
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '工厂',
          dataIndex: 'WERKS',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '经销商',
          dataIndex: 'KUNNR',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '配件号',
          dataIndex: 'MATNR',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '年月',
          dataIndex: 'SPBUP',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '版本',
          dataIndex: 'ZVSION',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '版本描述',
          dataIndex: 'ZDISC',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '参数',
          dataIndex: 'ZCS',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '金额',
          dataIndex: 'NETWR',
          sorter: true,
          filter: true,
          filterType: 'input'
        }
      ];
    }
  }
};
</script>

<style scoped></style>
